/*!
\file Node.h
\brief Contains definition of Node class.
\ingroup Graph
*/

#ifndef NODE_H
#define NODE_H

#include<QString>

/*!
\class Node
\brief Represents a Node. Can only be constructed by Graph.
\ingroup Graph
*/

class Node{
public:
	//Copy constructor
	Node( const Node &other );
	//!< Copy constructor. The only way a user may create a Node.
	
	//Accessor functions
	QString label()const;
	//!< Returns Node label.
	int identifier()const;
	//!< Returns Node identifier.
	
	//Overloaded operators
	bool operator==( const Node &other )const;
	//!< Compare two Nodes.
	void operator=( const Node &other );
	//!< Assignment operator.
	
	QString toString()const;
	//!< Returns a string representation of Node.
private:
	friend class Graph;
	QString m_label;
	int m_id;
	
	//Private constructors. A node may only be created through a graph.
	Node( int identifier );
	Node( QString label, int identifier );
	
	QString _toDOT()const;
};

#endif
